<?php
	header("Content-Type: text/html; charset=UTF-8");
	
	$__FILEPATH__ = dirname(__FILE__)."/";	
	require_once($__FILEPATH__."./func_common.php");
	require_once($__FILEPATH__."./class_def.php");
	require_once($__FILEPATH__."./conf/info.php");

	$begin_y = 2008;
	$end_y = intval(date("Y"));

	$PageArray = array();
	$mysqli = GetMysqliInstance();

	for ($i = $begin_y; $i <= $end_y; ++$i)
	{
		$Year = substr($i, 2, 2);
		$PageArray[$i] = array();
		$result = $mysqli->query("select username, nickname, imagesrc, award from acmerlist where studentnum like \"$Year%\"");
		if ($result)
		{
			while($row = $result->fetch_array(MYSQLI_ASSOC))
			{
				$AcmerItem = new AcmerListItem();
				$AcmerItem->username 	= $row["username"];
				$AcmerItem->nickname 	= $row["nickname"];
				$AcmerItem->imagesrc 	= $row["imagesrc"];
				$AcmerItem->award 		= $row["award"];
				$PageArray[$i][] = $AcmerItem;
			}
			$result->close();
		}
	}

?>